<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>快速转诊</title>
    <link rel="stylesheet" href="../../plugins/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../css/fa.css"/>
    <link rel="stylesheet" href="../../css/icon.css"/>
    <link rel="stylesheet" href="../../css/ares_animate.min.css"/>
    <link rel="stylesheet" href="../../css/ares_hover_variant.min.css"/>
    <link rel="stylesheet" href="../../css/ares_reboot.css"/>
    <link rel="stylesheet" href="../../css/app.min.css"/>
    <link rel="stylesheet" href="../../css/iframe.css"/>
    <style>

    </style>
</head>

<body>
<h3>基本信息</h3>
<form class="layui-form" lay-filter="base-info-form">
    <div class="ares-row layui-form-item">
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">患者姓名<i class="ares-text-red">*</i></label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入姓名" class="layui-input" lay-verType="tips" lay-verify="required">
            </div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">患者编号<i class="ares-text-red">*</i></label>
            <div class="layui-input-block">
                <input name="identity" placeholder="请输入身份证号" class="layui-input" lay-verType="tips" lay-verify="required|identity">
            </div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">出生日期<i class="ares-text-red">*</i></label>
            <div class="layui-input-block">
                <input name="birthday" id="birthday" placeholder="请选择出生日期" class="layui-input" lay-verType="tips" lay-verify="required" readonly>
            </div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">病患类型<i class="ares-text-red">*</i></label>
            <div id="patient-classify-wrap" class="layui-input-block"></div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">患者类型 <i class="ares-text-red">*</i></label>
            <div class="layui-input-block">
                <select name="patientType" lay-verType="tips" lay-verify="required">
                    <option value="">请选择</option>
                    <option value="1">住院患者</option>
                    <option value="2">门诊患者</option>
                </select>
            </div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">性别</label>
            <div id="sex-wrap" class="layui-input-block"></div>
        </div>
        <div class="ares-col-md-6 ares-col-lg-4">
            <label class="layui-form-label">医保类型</label>
            <div id="insurance-type-wrap" class="layui-input-block"></div>
        </div>
    </div>
    <button class="layui-btn layui-hide" lay-submit lay-filter="submit-base-info"></button>
</form>

<h3>简要病历</h3>
<div class="layui-tab layui-tab-card" lay-filter="type">
    <ul class="layui-tab-title">
        <li class="layui-this" lay-id="2">中风</li>
        <li lay-id="3">腰痛</li>
        <li lay-id="4">膝关节僵硬</li>
        <li lay-id="5">脊髓损伤</li>
        <li lay-id="1">脑性瘫痪</li>
    </ul>
    <div class="layui-tab-content">
        <div id="stroke" class="layui-tab-item layui-show">
            <form class="ares-p layui-form" lay-filter="stroke">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>主诉</label>
                    <div class="layui-input-block">
                        <textarea name="1-0-0" lay-verType="tips" lay-verify="required" placeholder="请输入主诉" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>现病史</label>
                    <div class="layui-input-block">
                        <textarea name="1-1-0" lay-verType="tips" lay-verify="required" placeholder="请输入现病史" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">专科检查</label>
                    <div class="layui-input-block">
                        <label class="inline-checkbox-label">Brunnstrom分期</label>
                        <div>
                            <div class="layui-inline">
                                <label class="inline-label">左上肢</label>
                                <div class="layui-inline">
                                    <select name="1-11-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="inline-label">左手部</label>
                                <div class="layui-inline">
                                    <select name="1-12-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="inline-label">左下肢</label>
                                <div class="layui-inline">
                                    <select name="1-13-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="inline-label">右上肢</label>
                                <div class="layui-inline">
                                    <select name="1-14-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="inline-label">右手部</label>
                                <div class="layui-inline">
                                    <select name="1-15-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="inline-label">右下肢</label>
                                <div class="layui-inline">
                                    <select name="1-16-0">
                                        <option value="">请选择</option>
                                        <option value="1">Ⅰ期</option>
                                        <option value="2">Ⅱ期</option>
                                        <option value="3">Ⅲ期</option>
                                        <option value="4">Ⅳ期</option>
                                        <option value="5">Ⅴ期</option>
                                        <option value="6">Ⅵ期</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label"><span class="ares-text-res">*</span>ADL评分(改良Barthel指数)</label>
                        <input type="number" name="1-19-0" autocomplete="off" lay-verify="required|number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                        <label class="inline-label">分</label>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">临床诊断</label>
                    <div class="layui-inline">
                        <label class="inline-label">西医诊断</label>
                        <div class="layui-inline">
                            <select name="1-26-0">
                                <option value="">请选择</option>
                                <option value="1">脑梗死</option>
                                <option value="2">椎动脉栓塞脑梗死</option>
                                <option value="3">颈动脉血栓形成脑梗死</option>
                                <option value="4">基底动脉栓塞脑梗死</option>
                                <option value="5">大脑动脉血栓形成脑梗死</option>
                                <option value="6">脑梗死后遗症</option>
                                <option value="7">丘脑梗死</option>
                                <option value="8">腔隙性脑梗死</option>
                                <option value="9">多发性脑梗死</option>
                                <option value="10">基底节动脉血栓脑梗死</option>
                                <option value="11">基底节脑梗死</option>
                                <option value="12">脑出血</option>
                                <option value="13">间脑出血</option>
                                <option value="14">丘脑出血</option>
                                <option value="15">脑出血后遗症</option>
                                <option value="16">小脑出血</option>
                                <option value="17">多发性脑出血</option>
                                <option value="18">高血压脑出血</option>
                                <option value="19">创伤性脑出血</option>
                                <option value="20">其它</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">中医诊断</label>
                        <div class="layui-inline">
                            <select name="1-27-0">
                                <option value="">请选择</option>
                                <option value="1">中风病(肝阳暴亢、风火上扰)</option>
                                <option value="2">中风病(风瘫瘀血、痹阻脉络)</option>
                                <option value="3">中风病(痰热腑实、风痰上扰)</option>
                                <option value="4">中风病(气虚血瘀)</option>
                                <option value="5">中风病(阴虚风动)</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">功能诊断</label>
                        <div class="layui-inline">
                            <select name="1-28-0">
                                <option value="">请选择</option>
                                <option value="1">肌力功能障碍</option>
                                <option value="2">肌张力功能障碍</option>
                                <option value="3">关节活动度功能障碍</option>
                                <option value="4">平衡功能</option>
                                <option value="5">言语功能障碍</option>
                                <option value="6">感觉功能障碍</option>
                                <option value="7">认知障碍</option>
                                <option value="8">ADL功能障碍</option>
                                <option value="9">步行功能障碍</option>
                                <option value="10">吞咽功能障碍</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">补充说明</label>
                        <textarea name="1-29-0" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-hide" data-type="2" lay-submit lay-filter="submit-stroke"></button>
                    </div>
                </div>
            </form>
        </div>
        <div id="osphyalgia" class="layui-tab-item">
            <form class="ares-p layui-form" lay-filter="osphyalgia">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>主诉</label>
                    <div class="layui-input-block">
                        <textarea name="2-0-0" lay-verType="tips" lay-verify="required" placeholder="请输入主诉" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>现病史</label>
                    <div class="layui-input-block">
                        <textarea name="2-1-0" lay-verType="tips" lay-verify="required" placeholder="请输入现病史" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>疼痛评定VAS</label>
                    <div class="layui-input-block">
                        <div class="layui-inline">
                            <input type="number" id="slider_result" name="2-2-0" autocomplete="off" lay-verify="required|number|range" lay-verType="tips" min="0" max="100" readonly
                                   class="layui-input inline-input">
                        </div>
                        <div class="layui-inline">
                            <input type="range" name="2-3-0" max="100" min="0" step="1"
                                   onchange="$('#slider_result').val($(this).val());"
                                   oninput="$('#slider_result').val($(this).val());">
                        </div>
                        <div class="layui-inline ares-text-xs">提示：无痛(0)到剧痛(100)</div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">一般情况</label>
                    <div class="layui-input-block">
                        <label class="inline-radio-label">腰痛及放射痛</label>
                        <div class="ares-row">
                            <label class="ares-col-12">部位</label>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-0" lay-skin="primary" value="0" title="左臀部">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-1" lay-skin="primary" value="1" title="左大腿后侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-2" lay-skin="primary" value="2" title="左小腿前外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-3" lay-skin="primary" value="3" title="左足背">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-4" lay-skin="primary" value="4" title="左拇指">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-5" lay-skin="primary" value="5" title="左小腿后外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-6" lay-skin="primary" value="6" title="左足跟">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-7" lay-skin="primary" value="7" title="左足背外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-8" lay-skin="primary" value="8" title="右臀部">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-9" lay-skin="primary" value="9" title="右大腿后外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-10" lay-skin="primary" value="10" title="右小腿前外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-11" lay-skin="primary" value="11" title="右足背">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-12" lay-skin="primary" value="12" title="右拇指">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-13" lay-skin="primary" value="13" title="右小腿后外侧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-14" lay-skin="primary" value="14" title="右足跟">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" name="2-14-15" lay-skin="primary" value="15" title="右足背外侧">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">临床诊断</label>
                    <div class="layui-inline">
                        <label class="inline-label">西医诊断</label>
                        <div class="layui-inline">
                            <select name="2-43-0">
                                <option value="">请选择</option>
                                <option value="1">腰肌劳损</option>
                                <option value="2">腰三横突综合征</option>
                                <option value="3">急性腰扭伤</option>
                                <option value="4">腰背部筋膜炎</option>
                                <option value="5">其它</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">中医诊断</label>
                        <div class="layui-inline">
                            <select name="2-44-0">
                                <option value="">请选择</option>
                                <option value="1">寒湿型</option>
                                <option value="2">瘀血型</option>
                                <option value="3">湿热型</option>
                                <option value="4">肾虚型(肾阴虚、肾阳虚)</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">功能诊断</label>
                        <div class="layui-inline">
                            <select name="2-45-0" id="print_2_45_0">
                                <option value="">请选择</option>
                                <option value="1">腰部疼痛</option>
                                <option value="2">腰部活动受限</option>
                                <option value="3">躯干肌力下降</option>
                                <option value="4">躯干稳定性下降</option>
                                <option value="5">姿势维持能力减退</option>
                                <option value="6">平衡功能减退</option>
                                <option value="7">ADL降低</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">补充说明</label>
                        <textarea name="2-46-0" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-hide" data-type="3" lay-submit lay-filter="submit-osphyalgia"></button>
                    </div>
                </div>
            </form>
        </div>
        <div id="knee-joint" class="layui-tab-item">
            <form class="ares-p layui-form" lay-filter="knee-joint">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>主诉</label>
                    <div class="layui-input-block">
                        <textarea name="3-0-0" lay-verType="tips" lay-verify="required" placeholder="请输入主诉" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>现病史</label>
                    <div class="layui-input-block">
                        <textarea name="3-1-0" lay-verType="tips" lay-verify="required" placeholder="请输入现病史" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">专科检查</label>
                    <div class="layui-input-block">
                        <label>压痛点</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-0" title="内膝眼">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-1" title="内侧间隙">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-2" title="内侧副韧带">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-3" title="髌骨下方">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-4" title="外膝眼">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-5" title="外侧间隙">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-6" title="外侧副韧带">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="checkbox" lay-skin="primary" name="3-5-7" title="髌骨周围">
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label>膝关节活动度</label>
                        <div class="ares-row">
                            <div class="ares-col-6">
                                <label class="inline-label">左屈曲</label>
                                <input type="number" name="3-6-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                                <label class="inline-label">度</label>
                            </div>
                            <div class="ares-col-6">
                                <label class="inline-label">右屈曲</label>
                                <input type="number" name="3-7-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                                <label class="inline-label">度</label>
                            </div>
                            <div class="ares-col-6">
                                <label class="inline-label">左伸展</label>
                                <input type="number" name="3-8-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                                <label class="inline-label">度</label>
                            </div>
                            <div class="ares-col-6">
                                <label class="inline-label">右伸展</label>
                                <input type="number" name="3-9-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                                <label class="inline-label">度</label>
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label>髌骨活动度</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="radio" name="3-10-0" value="0" title="正常">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="radio" name="3-10-0" value="1" title="左受限">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-3">
                                <input type="radio" name="3-10-0" value="2" title="右受限">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">临床诊断</label>
                    <div class="layui-inline">
                        <label class="inline-label">西医诊断</label>
                        <div class="layui-inline">
                            <select name="3-30-0">
                                <option>请选择</option>
                                <option>膝关节退行性骨关节炎</option>
                                <option>膝关节滑膜炎</option>
                                <option>风湿性关节炎</option>
                                <option>股骨骨折术后</option>
                                <option>胫骨骨折术后</option>
                                <option>髌骨骨折术后</option>
                                <option>膝关节创伤或韧带修复术后</option>
                                <option>膝关节置换术后</option>
                                <option>其它</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">中医诊断</label>
                        <div class="layui-inline">
                            <select name="3-31-0">
                                <option>请选择</option>
                                <option>骨痹(肾虚髓亏)</option>
                                <option>骨痹(阳虚寒凝)</option>
                                <option>骨痹(瘀血阻滞)</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">功能诊断</label>
                        <div class="layui-inline">
                            <select name="3-32-0">
                                <option>请选择</option>
                                <option>肌力障碍</option>
                                <option>活动障碍</option>
                                <option>疼痛障碍</option>
                                <option>功能障碍</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">补充说明</label>
                        <textarea name="3-33-0" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-hide" data-type="4" lay-submit lay-filter="submit-knee-joint"></button>
                    </div>
                </div>
            </form>
        </div>
        <div id="spine-injure" class="layui-tab-item">
            <form class="ares-p layui-form" lay-filter="spine-injure">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>主诉</label>
                    <div class="layui-input-block">
                        <textarea name="5-0-0" lay-verType="tips" lay-verify="required" placeholder="请输入主诉" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>现病史</label>
                    <div class="layui-input-block">
                        <textarea name="5-1-0" lay-verType="tips" lay-verify="required" placeholder="请输入现病史" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>损害程度分级</label>
                    <div class="layui-input-block">
                        <input type="radio" name="5-31-0" value="A" title="A、 完全性损害，骶区无任何感觉和运动功能保留" lay-verify="requiredRaido" lay-verify-label="损害程度分级">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-31-0" value="B" title="B、 不完全性损害，在神经平面以下包括骶段（S4,5）存在感觉功能但无运动功能">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-31-0" value="C" title="C、 不完全性损害，在神经平面以下存在运动功能，50%以上关键肌的肌力小于3级">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-31-0" value="D" title="D、 不完全性损害，在神经平面以下存在运动功能，并且50%以上关键肌的肌力大或等于3级">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-31-0" value="E" title="E、 感觉和运动功能正常">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>修订Ashworth分级评价标准</label>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="0级：无肌张力增加" lay-verify="requiredRaido" lay-verify-label="修订Ashworth分级评价标准">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="Ⅰ级：肌张力轻度增加，受累部分被动屈伸时，在活动范围之末时出现最小阻力或突然出现的卡住和放松">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="Ⅰ+级：肌张力稍增高，在关节活动范围50%之内出现突然卡住，然后在关节活动范围50%之后均呈现最小阻力">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="Ⅱ级：肌张力增加较明显，关节活动范围的大部分肌张力明显增加，但受累部分仍能较容易的被动活动">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="Ⅲ级：肌张力严重增高，被动活动困难">
                    </div>
                    <div class="layui-input-block">
                        <input type="radio" name="5-32-0" value="A" title="Ⅳ级：挛缩，受累部分被动屈伸时呈挛缩状态而不能动">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-res">*</span>ADL评分(改良Barthel指数)</label>
                    <div class="layui-input-block">
                        <input type="number" name="5-33-0" autocomplete="off" lay-verify="required|number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                        <label class="inline-label">分</label>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">临床诊断</label>
                    <div class="layui-inline">
                        <label class="inline-label">西医诊断</label>
                        <div class="layui-inline">
                            <select name="5-34-0">
                                <option>请选择</option>
                                <option>外伤性脊髓损伤</option>
                                <option>脊髓动脉瘤</option>
                                <option>脊髓肿瘤</option>
                                <option>脊髓炎</option>
                                <option>视神经脊髓炎</option>
                                <option>脊髓侧索硬化</option>
                                <option>多发性硬化</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="inline-label">中医诊断</label>
                        <div class="layui-inline">
                            <select name="5-35-0">
                                <option>请选择</option>
                                <option>痿证</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">补充说明</label>
                        <textarea name="5-36-0" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-hide" data-type="5" lay-submit lay-filter="submit-spine-injure"></button>
                    </div>
                </div>
            </form>
        </div>
        <div id="cerebral-palsy" class="layui-tab-item">
            <form class="ares-p layui-form" lay-filter="cerebral-palsy">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>主诉</label>
                    <div class="layui-input-block">
                        <textarea name="0-0-0" lay-verify="required" lay-verType="tips" placeholder="请输入主诉" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="ares-text-red">*</span>现病史</label>
                    <div class="layui-input-block">
                        <textarea name="0-1-0" lay-verify="required" lay-verType="tips" placeholder="请输入现病史" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">出生史</label>
                    <div class="layui-input-block ares-row">
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">第</label>
                            <input type="number" name="0-2-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">胎</label>
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">第</label>
                            <input type="number" name="0-3-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">产</label>
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">胎龄</label>
                            <input type="number" name="0-4-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">周</label>
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">胎龄</label>
                            <input type="number" name="0-4-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">周</label>
                            <input type="number" name="0-5-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">天</label>
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">出生体重</label>
                            <input type="number" name="0-6-0" autocomplete="off" lay-verify="number|min" lay-verType="tips" min="0" class="layui-input inline-input">
                            <label class="inline-label">kg</label>
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label"></label>
                            <input type="radio" name="0-7-0" value="0" title="顺产" checked>
                            <input type="radio" name="0-7-0" value="1" title="剖腹产">
                        </div>
                        <div class="ares-col-sm-12 ares-col-md-6">
                            <label class="prefix-label inline-label">Apgar评分</label>
                            <input type="number" name="0-8-0" autocomplete="off" lay-verify="number|range" lay-verType="tips" min="0" max="10" class="layui-input inline-input">
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label>孕期</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-0" title="母患疾病">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-1" title="妊娠中毒">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-2" title="低血糖">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-3" title="胎盘脐带羊水异常">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-4" title="病毒感染">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-5" title="缺氧">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-6" title="药物影响">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-9-7" title="遗传性神经疾病">
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label>出生时</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-0" title="创伤">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-1" title="窒息">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-2" title="早产">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-3" title="足月小样儿">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-4" title="巨大儿">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-5" title="低体重儿">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-6" title="多胎">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-7" title="异常分娩">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-10-8" title="过期产">
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label>出生后</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-11-0" title="窒息">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-11-1" title="脑出血">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-11-2" title="黄疸">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-11-3" title="颅内感染">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-11-4" title="缺氧缺血性脑病">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">反射检查</label>
                    <div class="layui-input-block">
                        <label class="inline-radio-label"><span class="ares-text-red">*</span>GMFCS运动功能评定</label>
                        <input type="radio" name="0-36-0" value="0" title="Ⅰ级" lay-verType="tips" lay-verify="requiredRadio" lay-verify-label="GMFCS运动功能评定" checked>
                        <input type="radio" name="0-36-0" value="1" title="Ⅱ级">
                        <input type="radio" name="0-36-0" value="2" title="Ⅲ级">
                        <input type="radio" name="0-36-0" value="3" title="Ⅳ级">
                        <input type="radio" name="0-36-0" value="4" title="Ⅴ级">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">临床诊断</label>
                    <div class="layui-input-block">
                        <label class="inline-label">西医诊断</label>
                        <textarea name="0-37-0" placeholder="请输入西医诊断" class="layui-textarea"></textarea>
                        <div class="layui-inline ares-mt-sm">
                            <label class="inline-label">分型</label>
                            <div class="layui-inline">
                                <select name="0-38-0">
                                    <option value="">请选择</option>
                                    <option value="1">痉挛型</option>
                                    <option value="2">四肢瘫</option>
                                    <option value="3">双瘫</option>
                                    <option value="4">偏瘫</option>
                                    <option value="5">不随意运动型</option>
                                    <option value="6">共济失调型</option>
                                    <option value="7">混合型</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">中医诊断</label>
                        <div>
                            <input type="checkbox" lay-skin="primary" name="0-39-0" title="五迟、五软">
                            <input type="checkbox" lay-skin="primary" name="0-39-1" title="五硬">
                            <input type="checkbox" lay-skin="primary" name="0-39-2" title="其它">
                            <textarea name="0-39-2-text" placeholder="请输入中医诊断其它补充说明" class="layui-textarea"></textarea>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">功能诊断</label>
                        <div class="ares-row">
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-0" title="智力功能(b117)障碍">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-1" title="语言接受障碍(b1760)">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-2" title="语言表达障碍(b1671)">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-3" title="听觉功能(b230) 障碍">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-4" title="吞咽(b5105)困难">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-5" title="视敏度功能(b2100)障碍">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-6" title="消化功能(b515)障碍">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-7" title="痛觉(b280)">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-8" title="多关节的运动(b7101)障碍">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-9" title="肌张力功能(b735)">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-10" title="肌张力低下">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-11" title="痉挛">
                            </div>
                            <div class="ares-col-sm-6 ares-col-md-4">
                                <input type="checkbox" lay-skin="primary" name="0-40-12" title="强直">
                            </div>
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <label class="inline-label">中医辨证</label>
                        <div>
                            <label class="inline-checkbox-label">主症</label>
                            <input type="checkbox" lay-skin="primary" name="0-41-0" title="软">
                            <input type="checkbox" lay-skin="primary" name="0-41-1" title="硬">
                            <input type="checkbox" lay-skin="primary" name="0-41-2" title="其它">
                            <textarea name="0-41-2-text" placeholder="请输入主症其它补充说明" class="layui-textarea"></textarea>
                        </div>
                        <div>
                            <label class="inline-checkbox-label">核心证候</label>
                            <input type="checkbox" lay-skin="primary" name="0-42-0" title="气虚血瘀">
                            <input type="checkbox" lay-skin="primary" name="0-42-1" title="肝肾不足">
                            <input type="checkbox" lay-skin="primary" name="0-42-2" title="脾气虚">
                            <input type="checkbox" lay-skin="primary" name="0-42-3" title="心脾两虚">
                            <input type="checkbox" lay-skin="primary" name="0-42-4" title="其它">
                            <textarea name="0-42-4-text" placeholder="请输入主症其它补充说明" class="layui-textarea"></textarea>
                        </div>
                        <div>
                            <label class="inline-checkbox-label">体质辨证</label>
                            <input type="checkbox" lay-skin="primary" name="0-43-0" title="营卫不和">
                            <input type="checkbox" lay-skin="primary" name="0-43-1" title="心胆虚怯">
                            <input type="checkbox" lay-skin="primary" name="0-43-2" title="阴虚火旺">
                            <input type="checkbox" lay-skin="primary" name="0-43-3" title="其它">
                            <textarea name="0-43-3-text" placeholder="请输入体质辨证其它说明" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-hide" data-type="1" lay-submit lay-filter="submit-cerebral-palsy"></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<h3>转诊信息</h3>
<form class="layui-form" lay-filter="transfer-form">
    <div class="layui-form-item">
        <label class="layui-form-label">转诊备注</label>
        <div class="layui-input-block">
            <input type="radio" name="newRemark" lay-filter="newRemark" value="1" lay-verify-label="转诊备注"
                   lay-verify="requiredRaido" title="患者病情稳定，转入下一级医院治疗" checked>
            <input type="radio" name="newRemark" lay-filter="newRemark" value="2" title="患者病情出现变化，转入上一级医院治疗">
            <input type="radio" name="newRemark" lay-filter="newRemark" value="3" title="家庭康复">
            <input type="radio" name="newRemark" lay-filter="newRemark" value="4" title="其他情况">
            <input class="layui-input" name="remarkText" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">通知医生</label>
        <div class="layui-input-block">
            <input type="radio" name="hospital-doctor-radios" lay-filter="hospital-doctor-radios" value="1"
                   lay-verify-label="通知医生" lay-verify="requiredRaido" title="所有系统医生" checked>
            <input type="radio" name="hospital-doctor-radios" lay-filter="hospital-doctor-radios" value="2"
                   title="指定医生">
        </div>
    </div>
    <div class="assign-doctor layui-hide">
        <div class="layui-form-item">
            <label class="layui-form-label">选择区域</label>
            <div class="layui-input-block">
                <select name="hospital-district-select" lay-filter="hospital-district-select"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">医院分类</label>
            <div class="layui-input-block">
                <select name="hospital-level-select" lay-filter="hospital-level-select"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择医院</label>
            <div class="layui-input-block">
                <select name="hospitalSelect" lay-filter="hospitalSelect"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择医生</label>
            <div class="layui-input-block">
                <select name="doctorSelect" lay-filter="doctorSelect"></select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <button class="layui-btn layui-hide" lay-submit lay-filter="transfer-submit"></button>
    </div>
</form>

<div class="ares-p-lg ares-text-center">
    <button id="submit-btn" class="layui-btn">提交转诊</button>
</div>

<script type="text/javascript" src="../../plugins/layui/layui.js"></script>
<script type="text/javascript" src="../../aresExtends/config/layuiConfig.js"></script>
<script>
    layui.use(['form', 'element', 'laydate', 'utils', 'filters', 'greyServices', 'mandyServices', 'commonServices', 'transferServices', 'store', 'constants', 'widget', 'dayjs'], function (form, element, laydate, utils, filters, greyServices, mandyServices, commonServices, transferServices, store, constants, widget, dayjs) {
        var hospitalId = store.session.get("hospital"), hospitalMap = {};

        var $submitBaseInfoBtn = $('button[lay-filter="submit-base-info"]'),
            $submitTransferBtn = $('button[lay-filter="transfer-submit"]'),
            $submitBtn = $('#submit-btn');

        var diseaseTypeId = 2;

        var spineInjureTotalSenseScore = 0, spineInjureTotalMyodynamiaScore = 0;

        var baseInfoVerifyResult = false, diseaseVerifyResult = false, transferVerifyResult = false;

        var baseInfoFormData = {}, diseaseInfoFromData = {}, transferFormData = {};

        element.on('tab(type)', function (data) {
            diseaseTypeId = $(this).attr('lay-id');
        });
        form.on('submit(submit-base-info)', function (data) {
            baseInfoVerifyResult = true;
            baseInfoFormData = data.field;
            return false;
        })
        form.on('submit(submit-cerebral-palsy)', function (data) {
            diseaseVerifyResult = true;
            diseaseInfoFromData[diseaseTypeId] = data.field;
            return false;
        })
        form.on('submit(submit-stroke)', function (data) {
            diseaseVerifyResult = true;
            diseaseInfoFromData[diseaseTypeId] = data.field;
            return false;
        })
        form.on('submit(submit-osphyalgia)', function (data) {
            diseaseVerifyResult = true;
            diseaseInfoFromData[diseaseTypeId] = data.field;
            return false;
        })
        form.on('submit(submit-knee-joint)', function (data) {
            diseaseVerifyResult = true;
            diseaseInfoFromData[diseaseTypeId] = data.field;
            return false;
        })
        form.on('submit(submit-spine-injure)', function (data) {
            diseaseVerifyResult = true;
            diseaseInfoFromData[diseaseTypeId] = data.field;
            diseaseInfoFromData[diseaseTypeId].totalSenseScore = spineInjureTotalSenseScore;
            diseaseInfoFromData[diseaseTypeId].totalMyodynamiaScore = spineInjureTotalMyodynamiaScore;
            return false;
        })
        form.on('select(sense-level-select)', function () {
            var thisVal = $(this).attr('lay-value');
            thisVal = thisVal.length ? 1 * thisVal : 0;
            spineInjureTotalSenseScore += thisVal;
            $('#total-sense-score').text(spineInjureTotalSenseScore);
            $('#total-score').text(spineInjureTotalSenseScore + spineInjureTotalMyodynamiaScore);
        })
        form.on('select(myodynamia-level-select)', function () {
            var thisVal = $(this).attr('lay-value');
            thisVal = thisVal.length ? 1 * thisVal : 0;
            spineInjureTotalMyodynamiaScore += thisVal;
            $('#total-myodynamia-score').text(spineInjureTotalMyodynamiaScore);
            $('#total-score').text(spineInjureTotalSenseScore + spineInjureTotalMyodynamiaScore);
        })
        /**
         * @author: ares
         * @date: 2021/1/22 11:23
         * @description: 转诊备注切换
         */
        form.on('radio(newRemark)', function (data) {
            var $remarkText = $('input[name="remarkText"]');
            if (data.value == 4) {
                $remarkText.prop('disabled', false);
            } else {
                $remarkText.val('');
                $remarkText.prop('disabled', true);
            }
        });
        /**
         * @author: ares
         * @date: 2021/1/22 11:28
         * @description: 通知医生切换
         */
        form.on('radio(hospital-doctor-radios)', function (data) {
            var $assginDoctorDiv = $('.assign-doctor'),
                $hospitalDistrictSelect = $('select[name="hospital-district-select"]'),
                $hospitalLevelSelect = $('select[name="hospital-level-select"]'),
                $hospitalSelect = $('select[name="hospitalSelect"]'),
                $hospitalDoctorSelect = $('select[name="doctorSelect"]');
            if (data.value == 2) {
                $hospitalDistrictSelect.attr('lay-verType', 'tips').attr('lay-verify', 'required');
                $hospitalLevelSelect.attr('lay-verType', 'tips').attr('lay-verify', 'required');
                $hospitalSelect.attr('lay-verType', 'tips').attr('lay-verify', 'required');
                $hospitalDoctorSelect.attr('lay-verType', 'tips').attr('lay-verify', 'required');
                $assginDoctorDiv.removeClass('layui-hide');
            } else {
                $hospitalDistrictSelect.removeAttr('lay-verType').removeAttr('lay-verify');
                $hospitalLevelSelect.removeAttr('lay-verType').removeAttr('lay-verify');
                $hospitalSelect.removeAttr('lay-verType').removeAttr('lay-verify');
                $hospitalDoctorSelect.removeAttr('lay-verType').removeAttr('lay-verify');
                form.val('transfer-form', {
                    'hospital-district-select': '',
                    'hospital-level-select': '',
                    'hospitalSelect': '',
                    'doctorSelect': '',
                })
                $assginDoctorDiv.addClass('layui-hide');
            }
        });
        /**
         * @author: ares
         * @date: 2021/1/22 15:34
         * @description: 切换医院所在区域
         */
        form.on('select(hospital-district-select)', function (data) {
            var id = data.value,
                $hospitalLevelSelect = $('select[name="hospital-level-select"]'),
                $hospitalSelect = $('select[name="hospitalSelect"]'),
                $doctorSelect = $('select[name="doctorSelect"]');

            $hospitalLevelSelect.empty().append('<option value="">请选择医院分类</option>');
            $hospitalSelect.empty().append('<option value="">请选择医院</option>');
            $doctorSelect.empty().append('<option value="">请选择医生</option>');

            if (id) {
                var area = data.othis.find(".layui-this").text();
                makeHospitalLevelSelect(area);
            }
        })
        /**
         * @author: ares
         * @date: 2021/1/22 16:16
         * @description: 切换医院等级
         */
        form.on('select(hospital-level-select)', function (data) {
            var id = data.value,
                $hospitalDistrictSelect = $('select[name="hospital-district-select"]'),
                $hospitalSelect = $('select[name="hospitalSelect"]'),
                $doctorSelect = $('select[name="doctorSelect"]'),
                area = $hospitalDistrictSelect.next().find(".layui-this").text();

            $hospitalSelect.empty().append('<option value="">请选择医院</option>');
            $doctorSelect.empty().append('<option value="">请选择医生</option>');

            if (hospitalMap[area] && $.type(hospitalMap[area][id]) == 'array') {
                makeHospitalSelect(hospitalMap[area][id]);
            }
        })
        /**
         * @author: ares
         * @date: 2021/1/22 16:34
         * @description: 切换医院
         */
        form.on('select(hospitalSelect)', function (data) {
            var id = data.value,
                $doctorSelect = $('select[name="doctorSelect"]');
            $doctorSelect.empty().append('<option value="">请选择医院</option>');
            if (id) {
                commonServices.getTransferDoctorService(id).then(function (res) {
                    makeDoctorSelect(res.data);
                });
            }
        })
        form.on('submit(transfer-submit)', function (data) {
            var fields = data.field,
                $form = $(data.form);
            var newRemark = "";
            var $remarkChecked = $form.find("input[name='newRemark']:checked");
            var remarkCheckedValue = fields['newRemark'];

            if (4 != remarkCheckedValue) {
                newRemark = $remarkChecked.attr('title').trim();
            } else {
                newRemark = $form.find("input[name='remarkText']").val();
                if (newRemark.length > 128) {
                    utils.msgError('描述信息请不要超过128个字');
                    return false;
                }
                newRemark = newRemark.trim() == "" || newRemark == null ? "其他情况" : newRemark;
            }

            var info = $form.find("select[name='doctorSelect'] option:selected").data("info");
            transferVerifyResult = true;
            transferFormData = fields;
            transferFormData.remark = newRemark;
            transferFormData.doctorInfo = info;
            return false;
        })

        $submitBtn.on('click', function (event) {
            baseInfoVerifyResult = false;
            diseaseVerifyResult = false;
            transferVerifyResult = false;
            var $this = $(this),
                $diseaseTypeSubmitBtn = $('button[data-type="' + diseaseTypeId + '"]');
            $submitBaseInfoBtn.trigger('click');
            if (!baseInfoVerifyResult) {
                verifyFailScrollIntoView();
                return;
            }
            $diseaseTypeSubmitBtn.trigger('click');
            if (!diseaseVerifyResult) {
                verifyFailScrollIntoView();
                return;
            }
            $submitTransferBtn.trigger('click');
            if (!transferVerifyResult) {
                verifyFailScrollIntoView();
                return;
            }
            diseaseInfoFromData[diseaseTypeId]['patient-type'] = baseInfoFormData.patientType;
            var data = {
                diseaseId: diseaseTypeId,
                emrDto: {
                    insurance_type: baseInfoFormData.insuranceType,
                    patient_classify: baseInfoFormData.patientClassify,
                    patient_type: baseInfoFormData.patientType,
                    patient: {
                        name: baseInfoFormData.name,
                        real_name: baseInfoFormData.name,
                        sex: baseInfoFormData.sex,
                        birthday: dayjs(baseInfoFormData.birthday).valueOf(),
                        identity_card: baseInfoFormData.identity,
                    }
                },
                clinicVo: {
                    diseaseInfo: JSON.stringify(diseaseInfoFromData[diseaseTypeId]),
                    patientType: baseInfoFormData.patientType,
                },
                referDiffHosVo: {
                    receiveHospitalId: transferFormData.hospitalSelect,
                    receiveMedicalId: transferFormData.doctorSelect,
                    remark: transferFormData.newRemark,
                    prescribed: transferFormData.remarkText,
                    receiveHosDivAccDTO: transferFormData.doctorInfo,
                },
            };
            console.log(baseInfoFormData, diseaseInfoFromData, transferFormData, data)
            $this.prop('disabled', true).addClass('layui-btn-disabled');
            transferServices.fastTransferService(data).then(function (res) {
                utils.msgSuccess(res.message)
                $this.prop('disabled', false).removeClass('layui-btn-disabled')
                utils.closeCurrentSysTab();
            }).catch(function (err) {
                $this.prop('disabled', false).removeClass('layui-btn-disabled')
            });
        })

        //获取医院所在区域
        function buildDistrictSelect(cityId) {
            return mandyServices.mandy_get_district_list(cityId).then(function (res) {
                var data = res.data,
                    $hospitalDistrictSelect = $('select[name="hospital-district-select"]'),
                    $fragment = $(document.createDocumentFragment());
                $hospitalDistrictSelect.empty();
                $fragment.append($("<option value=''>请选择医院所在区</option>"));
                if (data.district_list.length == 0) {
                    utils.msgError("该城市没有任何区县，请检查cityId是否正确");
                    return;
                }
                $.each(data.district_list, function (idx, district) {
                    $fragment.append("<option value='" + district.id + "'>" + district.name + "</option>");
                });
                $hospitalDistrictSelect.append($fragment);
                form.render('select', 'transfer-form');
            });
        }

        //获取所有医院的信息，并按照医院等级、区域进行存储在hospitalMap中
        function getHospitalList() {
            greyServices.grey_get_hospital_list(null, null).then(function (res) {
                var data = res.data;
                hospitalMap = {};
                if (data.hospital_list) {
                    $.each(data.hospital_list, function (idx, val) {

                        var arr = hospitalMap[val.district.name];
                        arr = arr == null ? {} : arr;

                        var arr1 = arr[val.level + ""];
                        arr1 = arr1 == null ? [] : arr1;

                        arr1.push(val);
                        arr[val.level + ""] = arr1;

                        hospitalMap[val.district.name] = arr;
                    });
                }
                var options = $('select[name="hospital-district-select"] option');
                $.each(options, function (idx, option) {
                    if (hospitalMap[$(option).text()] == null && $(option).text().indexOf("请选择") == -1) {
                        $(option).attr("disabled", true);
                    }
                })
                form.render('select', 'transfer-form');
            });
        }

        //构建医生下拉列表
        function makeDoctorSelect(list) {
            $doctorSelect = $('select[name="doctorSelect"]'),
                $fragment = $(document.createDocumentFragment());
            $fragment.append('<option value="">请选择医生</option>');

            if ($.type(list) == 'array') {
                $.each(list, function (index, item) {
                    var option = $('<option value="' + item.id + '">' + item.name + '</option>');
                    option.data("info", item);
                    $fragment.append(option);
                });
            }
            $doctorSelect.empty().append($fragment);
            form.render('select', 'transfer-form');
        }

        //在此处对某区域某等级下的医院进行筛选
        function makeHospitalSelect(list) {
            $hospitalSelect = $('select[name="hospitalSelect"]'),
                $fragment = $(document.createDocumentFragment());
            $hospitalSelect.empty();
            $fragment.append('<option value="">请选择医院</option>');
            $.each(list, function (index, item) {
                var option = $('<option value="' + item.id + '">' + item.name + '</option>');
                if (hospitalId == item.id) option.text("当前医院").attr("disabled", true);
                $fragment.append(option);
            });
            $hospitalSelect.append($fragment);
            form.render('select', 'transfer-form');
        }

        //构建医院等级下拉列表
        function makeHospitalLevelSelect(area) {
            var $hospitalLevelSelect = $('select[name="hospital-level-select"]'),
                $fragment = $(document.createDocumentFragment());
            $hospitalLevelSelect.empty();
            $fragment.append('<option value="">请选择医院分类</option>');
            $.each(constants.hospitalLevelList, function (index, item) {
                var option = $('<option value="' + item.k + '">' + item.v + '</option>');
                if (!hospitalMap[area][item.k]) option.attr("disabled", true);
                $fragment.append(option);
            })
            $hospitalLevelSelect.append($fragment);
            form.render('select', 'transfer-form');
        }

        /**
         * @author: ares
         * @date: 2021/3/25 16:33
         * @description: 生成性别选项
         */
        function renderPatientSexRadio() {
            $('#sex-wrap').empty().append(widget.createSexRadio())
        }

        /**
         * @author: ares
         * @date: 2021/3/25 16:38
         * @description: 生成医保类型
         */
        function renderInsuranceTypeRadio() {
            $('#insurance-type-wrap').empty().append(widget.createInsuranceTypeRadio())
        }

        /**
         * @author: ares
         * @date: 2021/3/25 15:26
         * @description: 渲染病患类型下拉列表
         */
        function renderPatientClassifySelect() {
            $('#patient-classify-wrap').empty().append(widget.createPatientClassifySelect('patientClassify', {verify: {'lay-verType': 'tips', 'lay-verify': 'required'}}));
            form.render('select');
        }

        /**
         * @author: ares
         * @date: 2021/4/7 12:45
         * @description: 渲染脊椎损伤感觉下拉列表
         */
        function renderSpineInjureSenseLevelSelect() {
            var list = [
                    {name: '请选择', value: ''},
                    {name: '缺失', value: 0},
                    {name: '障碍', value: 1},
                    {name: '正常', value: 2},
                ],
                $fragment = $(document.createDocumentFragment()),
                $select = $('.sense-level-select');
            $.each(list, function (index, item) {
                $fragment.append('<option value="' + item.value + '">' + item.name + '</option>');
            });
            $select.empty().append($fragment);
        }

        /**
         * @author: ares
         * @date: 2021/4/7 12:45
         * @description: 渲染脊椎损伤运动肌力下拉列表
         */
        function renderSpineInjureMyodynamiaLevelSelect() {
            var list = [
                    {name: '请选择', value: ''},
                    {name: '0级', value: 0},
                    {name: 'Ⅰ级', value: 1},
                    {name: 'Ⅱ级', value: 2},
                    {name: 'Ⅲ级', value: 3},
                    {name: 'Ⅳ级', value: 4},
                    {name: 'Ⅴ级', value: 5},
                ],
                $fragment = $(document.createDocumentFragment()),
                $select = $('.myodynamia-level-select');
            $.each(list, function (index, item) {
                $fragment.append('<option value="' + item.value + '">' + item.name + '</option>');
            });
            $select.empty().append($fragment);
        }

        /**
         * @author: ares
         * @date: 2021/4/8 11:30
         * @description: 验证失败的dom滚动到可视区
         */
        function verifyFailScrollIntoView() {
            var $verifyFail = $('.layui-form-danger').next();
            $verifyFail.length && $verifyFail[0].scrollIntoViewIfNeeded();
        }

        /**
         * @author: ares
         * @date: 2021/3/25 15:24
         * @description: 初始化
         */
        function init() {
            laydate.render({
                elem: '#birthday',
                showBottom: false,
                value: new Date()
            });
            renderPatientSexRadio();
            renderInsuranceTypeRadio();
            renderPatientClassifySelect();
            renderSpineInjureSenseLevelSelect();
            renderSpineInjureMyodynamiaLevelSelect();
            buildDistrictSelect(109).then(function () {
                getHospitalList();
            });
            form.render();
        }

        init()
    })
</script>
</body>
</html>
